package org.newdawn.yapgame;

/**
 * A central reference point for creating resources for use in the game. The
 * resources return may be implemented in several different rendering contexts
 * but will also work within the GameWindow supplied from this class. For
 * instance, a Sprite retrieved as a resource will draw happily in the
 * GameWindow supplied from this factory
 * 
 * @author Marko Walther
 * @author Kevin Glass
 */
public interface IResourceFactory
{
    /**
     * Set the rendering method that should be used. Note: This can only be done
     * before the first resource is accessed.
     * 
     * @param renderingType
     *            The type of rendering to use
     */

    /**
     * Retrieve the game window that should be used to render the game
     * 
     * @return The game window in which the game should be rendered
     */
    public GameWindow getGameWindow();
    
    /**
     * Create or get a sprite which displays the image that is pointed to in the
     * classpath by "ref"
     * 
     * @param ref
     *            A reference to the image to load
     * @return A sprite that can be drawn onto the current graphics context.
     */
    public ISprite getSprite(String ref);
}